#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.65])
AC_INIT(pitfall, 0.1.0, rodrigo.geof@gmail.com)
AM_INIT_AUTOMAKE(pitfall, 2.6)
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADERS([config.h])

# Checks for programs.
AC_PROG_CXX
AC_PROG_AWK
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB

# Checks for libraries.
# FIXME: Replace `main' with a function in `-lComplex':
AC_CHECK_LIB([Complex], [main])
# FIXME: Replace `main' with a function in `-lX11':
AC_CHECK_LIB([X11], [main])
# FIXME: Replace `main' with a function in `-lXm':
AC_CHECK_LIB([Xm], [main])
# FIXME: Replace `main' with a function in `-lXmcwp':
AC_CHECK_LIB([Xmcwp], [main])
# FIXME: Replace `main' with a function in `-lXt':
AC_CHECK_LIB([Xt], [main])
# FIXME: Replace `main' with a function in `-lXtcwp':
AC_CHECK_LIB([Xtcwp], [main])
# FIXME: Replace `main' with a function in `-lcomp':
AC_CHECK_LIB([comp], [main])
# FIXME: Replace `main' with a function in `-lcurses':
AC_CHECK_LIB([curses], [main])
# FIXME: Replace `main' with a function in `-lcwp':
AC_CHECK_LIB([cwp], [main])
# FIXME: Replace `main' with a function in `-ldga':
AC_CHECK_LIB([dga], [main])
# FIXME: Replace `main' with a function in `-ldps':
AC_CHECK_LIB([dps], [main])
# FIXME: Replace `main' with a function in `-lm':
AC_CHECK_LIB([m], [main])
# FIXME: Replace `main' with a function in `-lpar':
AC_CHECK_LIB([par], [main])
# FIXME: Replace `main' with a function in `-lposteriori':
AC_CHECK_LIB([posteriori], [main])
# FIXME: Replace `main' with a function in `-lpsplot':
AC_CHECK_LIB([psplot], [main])
# FIXME: Replace `main' with a function in `-lpvm':
AC_CHECK_LIB([pvm], [main])
# FIXME: Replace `main' with a function in `-lpvm3':
AC_CHECK_LIB([pvm3], [main])
# FIXME: Replace `main' with a function in `-lrandom':
AC_CHECK_LIB([random], [main])
# FIXME: Replace `main' with a function in `-lreflect':
AC_CHECK_LIB([reflect], [main])
# FIXME: Replace `main' with a function in `-lreflectivity':
AC_CHECK_LIB([reflectivity], [main])
# FIXME: Replace `main' with a function in `-lsfio':
AC_CHECK_LIB([sfio], [main])
# FIXME: Replace `main' with a function in `-lstratinv':
AC_CHECK_LIB([stratinv], [main])
# FIXME: Replace `main' with a function in `-lsu':
AC_CHECK_LIB([su], [main])
# FIXME: Replace `main' with a function in `-ltetra':
AC_CHECK_LIB([tetra], [main])
# FIXME: Replace `main' with a function in `-ltriang':
AC_CHECK_LIB([triang], [main])
# FIXME: Replace `main' with a function in `-ltrielas':
AC_CHECK_LIB([trielas], [main])
# FIXME: Replace `main' with a function in `-lwpc':
AC_CHECK_LIB([wpc], [main])
# FIXME: Replace `main' with a function in `-lwpc1':
AC_CHECK_LIB([wpc1], [main])
# FIXME: Replace `main' with a function in `-lxplot':
AC_CHECK_LIB([xplot], [main])

# Checks for header files.
AC_PATH_X
AC_CHECK_HEADERS([arpa/inet.h fcntl.h float.h inttypes.h limits.h locale.h malloc.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h values.h wchar.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_INT32_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_CHECK_MEMBERS([struct stat.st_blksize])
AC_CHECK_MEMBERS([struct stat.st_rdev])
AC_TYPE_UINT32_T
AC_CHECK_TYPES([ptrdiff_t])

# Checks for library functions.
AC_FUNC_ERROR_AT_LINE
AC_FUNC_FORK
AC_FUNC_FSEEKO
AC_HEADER_MAJOR
AC_FUNC_MALLOC
AC_FUNC_MBRTOWC
AC_FUNC_MMAP
AC_FUNC_REALLOC
AC_FUNC_STRTOD
AC_CHECK_FUNCS([alarm atexit bzero floor ftruncate gethostname getpagesize gettimeofday localeconv memchr memset modf pow select setlocale sqrt strchr strcspn strerror strrchr strspn strstr strtol strtoul])


AC_CONFIG_FILES([Makefile
                 doc/Makefile
                 examples/Makefile
                 man/Makefile
                 scripts/Makefile
                 src/Makefile])
AC_OUTPUT
